<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Peripheral Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
  </head>
  <body>
    <a name="//apple_ref/swift/Class/Peripheral" class="dashAnchor"></a>
    <a title="Peripheral Class Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html">Bluejay Docs</a> (100% documented)</p>
        <p class="header-right"><a href="https://github.com/steamclock/bluejay"><img src="../img/gh.png"/>View on GitHub</a></p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html">Bluejay Reference</a>
        <img id="carat" src="../img/carat.png" />
        Peripheral Class Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/Bluejay.html">Bluejay</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/Peripheral.html">Peripheral</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/SynchronizedPeripheral.html">SynchronizedPeripheral</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Enums/AutoReconnectMode.html">AutoReconnectMode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/BackgroundRestoreMode.html">BackgroundRestoreMode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/BluejayError.html">BluejayError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ConnectionResult.html">ConnectionResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/DisconnectionResult.html">DisconnectionResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ListenAction.html">ListenAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ReadResult.html">ReadResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/RunResult.html">RunResult</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/ScanAction.html">ScanAction</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/StartMode.html">StartMode</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/Timeout.html">Timeout</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/WriteResult.html">WriteResult</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Extensions/BinaryInteger.html">BinaryInteger</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBManagerState.html">CBManagerState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBPeripheral.html">CBPeripheral</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBPeripheralState.html">CBPeripheralState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/CBService.html">CBService</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/Data.html">Data</a>
              </li>
              <li class="nav-group-task">
                <a href="../Extensions/String.html">String</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Protocols/BackgroundRestorer.html">BackgroundRestorer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ConnectionObserver.html">ConnectionObserver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/DisconnectHandler.html">DisconnectHandler</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ListenRestorer.html">ListenRestorer</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/RSSIObserver.html">RSSIObserver</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/Receivable.html">Receivable</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/Sendable.html">Sendable</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/DataPadding.html">DataPadding</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/PeripheralIdentifier.html">PeripheralIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/ScanDiscovery.html">ScanDiscovery</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/ServiceIdentifier.html">ServiceIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/StartOptions.html">StartOptions</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/WarningOptions.html">WarningOptions</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:7Bluejay27BackgroundRestoreCompletiona">BackgroundRestoreCompletion</a>
              </li>
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:7Bluejay17RestoreIdentifiera">RestoreIdentifier</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>Peripheral</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">Peripheral</span> <span class="p">:</span> <span class="kt">NSObject</span></code></pre>

                </div>
              </div>
            <p>An interface to the Bluetooth peripheral.</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Attributes"></a>
                <a name="//apple_ref/swift/Section/Attributes" class="dashAnchor"></a>
                <a href="#/Attributes">
                  <h3 class="section-name">Attributes</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC4uuidAA0B10IdentifierVvp"></a>
                    <a name="//apple_ref/swift/Property/uuid" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC4uuidAA0B10IdentifierVvp">uuid</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The UUID of the peripheral.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">uuid</span><span class="p">:</span> <span class="kt"><a href="../Structs/PeripheralIdentifier.html">PeripheralIdentifier</a></span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC4nameSSvp"></a>
                    <a name="//apple_ref/swift/Property/name" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC4nameSSvp">name</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the name of the peripheral. If name is not available, return the uuid string.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">name</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/RSSI%20Event"></a>
                <a name="//apple_ref/swift/Section/RSSI Event" class="dashAnchor"></a>
                <a href="#/RSSI%20Event">
                  <h3 class="section-name">RSSI Event</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC8readRSSIyyF"></a>
                    <a name="//apple_ref/swift/Method/readRSSI()" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC8readRSSIyyF">readRSSI()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Requests the current RSSI value from the peripheral, and the value is returned via the <code><a href="../Protocols/RSSIObserver.html">RSSIObserver</a></code> delegation.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">readRSSI</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC8register8observeryAA12RSSIObserver_p_tF"></a>
                    <a name="//apple_ref/swift/Method/register(observer:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC8register8observeryAA12RSSIObserver_p_tF">register(observer:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Register a RSSI observer that can receive the RSSI value when <code>readRSSI</code> is called.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">register</span><span class="p">(</span><span class="nv">observer</span><span class="p">:</span> <span class="kt"><a href="../Protocols/RSSIObserver.html">RSSIObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC10unregister8observeryAA12RSSIObserver_p_tF"></a>
                    <a name="//apple_ref/swift/Method/unregister(observer:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC10unregister8observeryAA12RSSIObserver_p_tF">unregister(observer:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Unregister a RSSI observer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">unregister</span><span class="p">(</span><span class="nv">observer</span><span class="p">:</span> <span class="kt"><a href="../Protocols/RSSIObserver.html">RSSIObserver</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Actions"></a>
                <a name="//apple_ref/swift/Section/Actions" class="dashAnchor"></a>
                <a href="#/Actions">
                  <h3 class="section-name">Actions</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC4read4from10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF"></a>
                    <a name="//apple_ref/swift/Method/read(from:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC4read4from10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF">read(from:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Read from a specified characteristic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">read</span><span class="o">&lt;</span><span class="kt">R</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span><span class="o">&gt;</span><span class="p">(</span><span class="n">from</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReadResult.html">ReadResult</a></span><span class="o">&lt;</span><span class="kt">R</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC5write2to5value4type10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVyAA0K6ResultOctAA8SendableRzlF"></a>
                    <a name="//apple_ref/swift/Method/write(to:value:type:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC5write2to5value4type10completionyAA24CharacteristicIdentifierV_xSo25CBCharacteristicWriteTypeVyAA0K6ResultOctAA8SendableRzlF">write(to:value:type:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Write to a specified characteristic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">write</span><span class="o">&lt;</span><span class="kt">S</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Sendable.html">Sendable</a></span><span class="o">&gt;</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">S</span><span class="p">,</span> <span class="nv">type</span><span class="p">:</span> <span class="kt">CBCharacteristicWriteType</span> <span class="o">=</span> <span class="o">.</span><span class="n">withResponse</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/WriteResult.html">WriteResult</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC11isListening2toSbAA24CharacteristicIdentifierV_tF"></a>
                    <a name="//apple_ref/swift/Method/isListening(to:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC11isListening2toSbAA24CharacteristicIdentifierV_tF">isListening(to:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Checks whether Bluejay is currently listening to the specified charactersitic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">isListening</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC6listen2to10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF"></a>
                    <a name="//apple_ref/swift/Method/listen(to:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC6listen2to10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF">listen(to:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Listen for notifications on a specified characterstic.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">listen</span><span class="o">&lt;</span><span class="kt">R</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span><span class="o">&gt;</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReadResult.html">ReadResult</a></span><span class="o">&lt;</span><span class="kt">R</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC9endListen2to5error10completionyAA24CharacteristicIdentifierV_s5Error_pSgyAA11WriteResultOcSgtF"></a>
                    <a name="//apple_ref/swift/Method/endListen(to:error:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC9endListen2to5error10completionyAA24CharacteristicIdentifierV_s5Error_pSgyAA11WriteResultOcSgtF">endListen(to:error:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>End listening on a specified characteristic.</p>

<p>Provides the ability to suppress the failure message to the listen callback. This is useful in the internal implimentation of some of the listening logic, since we want to be able to share the clear logic on a .done exit, but don&rsquo;t need to send a failure in that case.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    Note
Currently this can also cancel a regular in-progress read as well, but that behaviour may change down the road.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">endListen</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="p">((</span><span class="kt"><a href="../Enums/WriteResult.html">WriteResult</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC13restoreListen2to10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF"></a>
                    <a name="//apple_ref/swift/Method/restoreListen(to:completion:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC13restoreListen2to10completionyAA24CharacteristicIdentifierV_yAA10ReadResultOyxGctAA10ReceivableRzlF">restoreListen(to:completion:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Restore a (believed to be) active listening session, so if we start up in response to a notification, we can receive it.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="n">restoreListen</span><span class="o">&lt;</span><span class="kt">R</span><span class="p">:</span> <span class="kt"><a href="../Protocols/Receivable.html">Receivable</a></span><span class="o">&gt;</span><span class="p">(</span><span class="n">to</span> <span class="nv">characteristicIdentifier</span><span class="p">:</span> <span class="kt"><a href="../Structs/CharacteristicIdentifier.html">CharacteristicIdentifier</a></span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReadResult.html">ReadResult</a></span><span class="o">&lt;</span><span class="kt">R</span><span class="o">&gt;</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Listen%20Caching"></a>
                <a name="//apple_ref/swift/Section/Listen Caching" class="dashAnchor"></a>
                <a href="#/Listen%20Caching">
                  <h3 class="section-name">Listen Caching</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:7Bluejay10PeripheralC23maximumWriteValueLength3forSiSo016CBCharacteristicD4TypeV_tF"></a>
                    <a name="//apple_ref/swift/Method/maximumWriteValueLength(for:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:7Bluejay10PeripheralC23maximumWriteValueLength3forSiSo016CBCharacteristicD4TypeV_tF">maximumWriteValueLength(for:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Ask for the peripheral&rsquo;s maximum payload length in bytes for a single write request.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">maximumWriteValueLength</span><span class="p">(</span><span class="k">for</span> <span class="nv">writeType</span><span class="p">:</span> <span class="kt">CBCharacteristicWriteType</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/CBPeripheralDelegate"></a>
                <a name="//apple_ref/swift/Section/CBPeripheralDelegate" class="dashAnchor"></a>
                <a href="#/CBPeripheralDelegate">
                  <h3 class="section-name">CBPeripheralDelegate</h3>
                </a>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverServices:"></a>
                    <a name="//apple_ref/swift/Method/peripheral(_:didDiscoverServices:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverServices:">peripheral(_:didDiscoverServices:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Captures CoreBluetooth&rsquo;s did discover services event and pass it to Bluejay&rsquo;s queue for processing.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">peripheral</span><span class="p">(</span><span class="n">_</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">,</span> <span class="n">didDiscoverServices</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverCharacteristicsForService:error:"></a>
                    <a name="//apple_ref/swift/Method/peripheral(_:didDiscoverCharacteristicsFor:error:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didDiscoverCharacteristicsForService:error:">peripheral(_:didDiscoverCharacteristicsFor:error:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Captures CoreBluetooth&rsquo;s did discover characteristics event and pass it to Bluejay&rsquo;s queue for processing.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">peripheral</span><span class="p">(</span><span class="n">_</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">,</span> <span class="n">didDiscoverCharacteristicsFor</span> <span class="nv">service</span><span class="p">:</span> <span class="kt">CBService</span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didWriteValueForCharacteristic:error:"></a>
                    <a name="//apple_ref/swift/Method/peripheral(_:didWriteValueFor:error:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didWriteValueForCharacteristic:error:">peripheral(_:didWriteValueFor:error:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Captures CoreBluetooth&rsquo;s did write to charactersitic event and pass it to Bluejay&rsquo;s queue for processing.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">peripheral</span><span class="p">(</span><span class="n">_</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">,</span> <span class="n">didWriteValueFor</span> <span class="nv">characteristic</span><span class="p">:</span> <span class="kt">CBCharacteristic</span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateValueForCharacteristic:error:"></a>
                    <a name="//apple_ref/swift/Method/peripheral(_:didUpdateValueFor:error:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateValueForCharacteristic:error:">peripheral(_:didUpdateValueFor:error:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Captures CoreBluetooth&rsquo;s did receive a notification/value from a characteristic event and pass it to Bluejay&rsquo;s queue for processing.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">peripheral</span><span class="p">(</span><span class="n">_</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">,</span> <span class="n">didUpdateValueFor</span> <span class="nv">characteristic</span><span class="p">:</span> <span class="kt">CBCharacteristic</span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateNotificationStateForCharacteristic:error:"></a>
                    <a name="//apple_ref/swift/Method/peripheral(_:didUpdateNotificationStateFor:error:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didUpdateNotificationStateForCharacteristic:error:">peripheral(_:didUpdateNotificationStateFor:error:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Captures CoreBluetooth&rsquo;s did turn on or off notification/listening on a characteristic event and pass it to Bluejay&rsquo;s queue for processing.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">peripheral</span><span class="p">(</span><span class="n">_</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">,</span> <span class="n">didUpdateNotificationStateFor</span> <span class="nv">characteristic</span><span class="p">:</span> <span class="kt">CBCharacteristic</span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didReadRSSI:error:"></a>
                    <a name="//apple_ref/swift/Method/peripheral(_:didReadRSSI:error:)" class="dashAnchor"></a>
                    <a class="token" href="#/c:@CM@Bluejay@objc(cs)Peripheral(im)peripheral:didReadRSSI:error:">peripheral(_:didReadRSSI:error:)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Captures CoreBluetooth&rsquo;s did read RSSI event and pass it to Bluejay&rsquo;s queue for processing.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">peripheral</span><span class="p">(</span><span class="n">_</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt">CBPeripheral</span><span class="p">,</span> <span class="n">didReadRSSI</span> <span class="kt">RSSI</span><span class="p">:</span> <span class="kt">NSNumber</span><span class="p">,</span> <span class="nv">error</span><span class="p">:</span> <span class="kt">Error</span><span class="p">?)</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>Copyright © 2017 Steamclock Software. All rights reserved.</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
